﻿<%@ Page Language="C#" MasterPageFile="~/Manager.master" AutoEventWireup="true" CodeFile="Film.aspx.cs" Inherits="Manager_Product_Film" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table border="1" bordercolor="#407db3" cellpadding="2" cellspacing="2" class="tbl_Comon-Search"
        style="border-collapse: collapse; margin-left: 0px; width: 100%;" width="100%">
        <tr>
            <td align="center" nowrap="nowrap" rowspan="2" valign="middle" style="width: 4%">
                <asp:Button ID="btnSearch" runat="server" CssClass="cssButton" Text="Tìm kiếm" Width="80px"
                    OnClick="btnSearch_Click" /></td>
            <td nowrap="nowrap" style="width: 10%; white-space: nowrap;" class="td_Title">
                <asp:Label ID="Label1" runat="server" CssClass="lbl_Common-Search" Text="Tên sản phẩm"></asp:Label></td>
            <td nowrap="nowrap" class="td_Control">
                <asp:TextBox ID="txtTenSP" runat="server" Height="20px" Width="98%" CssClass="txt_Product"></asp:TextBox></td>
            <td nowrap="nowrap" class="td_Title" style="display:none; width: 10%; white-space: nowrap;">
                <asp:Label ID="Label2" runat="server" CssClass="lbl_Common-Search" Text="Chủ đề"></asp:Label></td>
            <td nowrap="nowrap" class="td_Control" style="display:none;">
                <asp:DropDownList ID="ddlChuDe" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlChuDe_SelectedIndexChanged">
                </asp:DropDownList></td>
        </tr>
        <tr>
            <td nowrap="nowrap" class="td_Title" style="width: 10%; white-space: nowrap;">
                <asp:Label ID="Label4" runat="server" CssClass="lbl_Common-Search" Text="Mã sản phẩm"></asp:Label></td>
            <td nowrap="nowrap" class="td_Control">
                <asp:TextBox ID="txtPDID" runat="server" CssClass="txt_Product" Height="20px" Width="60%"></asp:TextBox></td>
            <td class="td_Title" nowrap="nowrap" style="width: 10%; white-space: nowrap">
                <asp:Label ID="Label3" runat="server" CssClass="lbl_Common-Search" Text="Thể loại"></asp:Label></td>
            <td class="td_Control" nowrap="nowrap" style="width: 30%">
                <asp:DropDownList ID="ddlTheLoai" runat="server">
                </asp:DropDownList></td>
        </tr>
        <tr>
            <td align="left" colspan="5" nowrap="nowrap" valign="top">
                <asp:Button ID="btnAdd" runat="server" CssClass="cssButton" Text="Thêm mới" Width="80px"
                    OnClick="btnAdd_Click" /></td>
        </tr>
    </table>
    <br />
    <asp:GridView ID="grv_Master" runat="server" CellPadding="2" BorderColor="#407DB3"
        BorderWidth="1px" AutoGenerateColumns="False" Width="100%" AllowPaging="True"
        DataKeyNames="FilmID" PageSize="20" OnRowDataBound="Grv_Product_RowDataBound" OnRowCreated="grv_Master_RowCreated1"
        OnRowDeleting="grv_Master_RowDeleting1" OnPageIndexChanging="grv_Master_PageIndexChanging">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <img id='imgedit' alt="Edit" runat="server" border="0" onclick="OpenProductDetail(this)"
                        pdid='<%# Eval("FilmID") %>' catid='<%# Eval("CatID") %>' topicid='<%# Eval("TopicID") %>'
                        src="../../Images/Icon/cmdEdit.gif" style="cursor: pointer" />
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="10px" Wrap="False" />
                <HeaderStyle CssClass="cssBorderGrv" />
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:LinkButton ID="lblDelete" runat="server" CommandName="delete" Text="<img src=../../Images/Icon/cmdDelete.gif border=0 alt=Delete > "></asp:LinkButton>
                    <input type="hidden" runat="server" value='<%# Eval("ImgURL") %>' id="hImgURL" />
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="10px" />
                <HeaderStyle CssClass="cssBorderGrv" />
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    Mã sản phẩm
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2232" runat="server" Text='<%# Eval("FilmID") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="10px" Wrap="False" />
                <HeaderStyle CssClass="cssBorderGrv" />
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    Tên Sản phẩm
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("FilmEng") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" />
                <HeaderStyle CssClass="cssBorderGrv" HorizontalAlign="Left" />
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    Chủ đề-Thể loại
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label55" runat="server" Text='<%# Eval("TopicName") %>'></asp:Label>
                    -
                    <asp:Label ID="Label5" runat="server" Text='<%# Eval("CatName") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" Width="10%" />
                <HeaderStyle CssClass="cssBorderGrv" Wrap="false" />
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    Đơn giá
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblPrice" runat="server" Text='0'></asp:Label>
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Right" Width="10%" />
                <HeaderStyle CssClass="cssBorderGrv" />
            </asp:TemplateField>
           <asp:TemplateField>
                <HeaderTemplate>
                   Add User
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblAddID" runat="server" Text='<%# Eval("AddUser") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="5%"  Wrap="false"/>
                <HeaderStyle CssClass="cssBorderGrv"   Wrap="false"/>
            </asp:TemplateField>
           <asp:TemplateField>
                <HeaderTemplate>
                    Update User
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblUpdID" runat="server" Text='<%# Eval("UpdateUser") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="5%"  Wrap="false"/>
                <HeaderStyle CssClass="cssBorderGrv"  Wrap="false" />
            </asp:TemplateField>  
            <asp:TemplateField>
                <ItemTemplate>
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="10px" Wrap="False" />
                <HeaderStyle CssClass="cssBorderGrv" />
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="10px" Wrap="False" />
                <HeaderStyle CssClass="cssBorderGrv" />
            </asp:TemplateField>
        </Columns>
        <RowStyle CssClass="gvRowStyle" />
        <AlternatingRowStyle CssClass="gvAlternatingRowStyle" />
        <HeaderStyle CssClass="gvHeader" />
        <PagerStyle CssClass="gvPaggingStyle" />
    </asp:GridView>

    <script language="javascript" type="text/javascript">
function OpenProductDetail(obj)
{
   		    
	    var value=obj.getAttribute("PDId");
	    var sTL=obj.getAttribute("CatID");
	    var TopicID=obj.getAttribute("TopicID");   
	    var ddlChuDe=document.getElementById("<%= ddlChuDe.ClientID %>");   
	    var ddlTheLoai=document.getElementById("<%= ddlTheLoai.ClientID %>");   	    	
	    var txtTenSP=document.getElementById("<%= txtTenSP.ClientID %>");   
	    var CodeID='<%= Request.QueryString["CodeID"]%>';	 
	    var KindNo='<%= Request.QueryString["KindNo"]%>';	
	    var iPageIndex='<%= iPageIndex%>';
	    window.location.href="AddFilm.aspx?KindNo="+KindNo+"&CodeID="+CodeID+"&sPdNm="+txtTenSP.value+"&sCatID="+ddlTheLoai.value+"&sTopicID="+ddlChuDe.value+"&TopicID="+TopicID+"&CatID="+sTL+"&PDID="+ value+"&PageIndex="+iPageIndex;
	    

}


    </script>

</asp:Content>

